<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="java.io.InputStream"%>
<%@page import="org.apache.ibatis.io.Resources"%>
<%@page import="org.apache.ibatis.session.SqlSessionFactory"%>
<%@page import="org.apache.ibatis.session.SqlSession"%>
<%@page import="java.io.IOException"%>
<%@page import="org.apache.ibatis.session.SqlSessionFactoryBuilder"%>
<%@page import="util.Info"%>
<%@page import="dao.CommDAO"%>
<%@page import="util.PageManager"%>

 
 <!-- Header -->
        <header id="header">
            <div class="container">
            
            
            
                   <div style="width: 100%;text-align: right;margin-top: 5px"> 
         <marquee behavior="scroll" direction="left" scrollamount="2"  style="width: 700px;float: left" ONMOUSEOUT="this.start();"  ONMOUSEOVER="this.stop()" >
		    <%=new CommDAO().getmap("7","mixinfo").get("content") %>
		    </marquee> 
                   <div id="time" style="display: inline"></div>
					<script type="text/javascript">
					function time(){
					var vWeek,vWeek_s,vDay;
					vWeek = ["星期天","星期一","星期二","星期三","星期四","星期五","星期六"];
					var date =  new Date();
					year = date.getFullYear();
					month = date.getMonth() + 1;
					day = date.getDate();
					hours = date.getHours();
					minutes = date.getMinutes();
					seconds = date.getSeconds();
					vWeek_s = date.getDay();
					document.getElementById("time").innerHTML = "<font face='宋体'>"+year + "年" + month + "月" + day + "日" + "\t" + hours + ":" + minutes +":" + seconds + "\t" + vWeek[vWeek_s]+"</font>" ;
					
					};
					setInterval("time()",1000);
					
					</script>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    
                    <%
						if (Info.getUser(request) == null) {
					%>
                         <a href="/wallpaper/regedit.jsp">
                         <font color="black"   style="font-size: 13px">会员注册</font> 
                         </a>
                         &nbsp;|&nbsp; 
                         <a href="/wallpaper/login.jsp">
                         <font color="black"   style="font-size: 13px">用户登录</font>  
                         </a>
                        <%
						} else {
					%>
					<font color=gray>
				          欢迎 : <%=Info.getUser(request).get("uname")%>
									- <%=Info.getUser(request).get("tname")%> &nbsp; ( <%=Info.getUser(request).get("utype")%>
									)  
			 
									
									 &nbsp;&nbsp; <a href="/wallpaper/index.jsp?z=z">[注销] </a> 
					</font>
					
					<table width="100%" height="0" border="0" cellpadding="0" cellspacing="0" style="border: 0px;margin-bottom: 0px">
					<tr><td height=0 style="border: 0px"></td></tr></table>
					<font style="font-size: 14px">
					 
					
					<%
					if(Info.getUser(request).get("utype").equals("管理员")){
					 %> 
					<a href="/wallpaper/admin/mixinfocx.jsp"><font color="#EA4748">网站基础信息</font></a>
					|  
					<a href="/wallpaper/admin/resourcescx.jsp"><font color="#EA4748">壁纸管理</font></a>
					|    
					<a href="/wallpaper/admin/messagescx.jsp"><font color="#EA4748">留言管理</font></a>
					| 
					<a href="/wallpaper/admin/tmixinfocx.jsp"><font color="#EA4748">滚动图片</font></a>
					|  
					<a href="/wallpaper/admin/hysysusercx.jsp"><font  color="#EA4748">会员信息管理</font></a>
					| 
					<a href="/wallpaper/admin/sysusercx.jsp"><font  color="#EA4748">管理员信息</font></a>
					| 
					<a href="/wallpaper/admin/psysuserxg.jsp"><font  color="#EA4748">修改个人信息</font></a>
					|
					<a href="/wallpaper/admin/uppass.jsp"><font  color="#EA4748">修改密码</font></a>
					<%} %>
					  
					<%
					if(Info.getUser(request).get("utype").equals("会员")){
					 %>  
					 <a href="/wallpaper/admin/xresourcescx.jsp"><font color="#EA4748">壁纸发布</font></a>
					|  
					<a href="/wallpaper/admin/psysuserxg.jsp"><font  color="#EA4748">修改个人信息</font></a>
					|
					<a href="/wallpaper/admin/uppass.jsp"><font  color="#EA4748">修改密码</font></a>
					<%} %>
					 
					
					</font>
					<%
						}
					%> 
                         
                     
                         
                    </div>
                     
                     
                     
             
                <div class="column"  >
                    <div class="logo"> 
                        <a href="/wallpaper/index.jsp">
                           <font style="font-size: 22px" face="黑体;" color="black">桌面壁纸网站</font>
                        </a>  
                    </div>
                    
                    <div class="search" >
                        <form action="resource.jsp" method="post" name="f33" onsubmit="return checkSearch()"> 
                             <select style="height: 35px;border:0px solid #eee;" name="type">
                             <option value="">请选择</option>
                             <option value="1">自然风光</option>
                             <option value="2">社会人文</option>
                             <option value="3">艺术作品</option> 
                             <option value="4">科技科幻</option> 
                             </select>
                            
                            <input type="text" style="width: 190px" name="key" value="Search." onblur="if(this.value=='') this.value='Search.';" onfocus="if(this.value=='Search.') this.value='';" class="ft"/>
                            <input type="submit" value="" class="fs">
                             <script type="text/javascript">
                             function checkSearch()
                             {
                                if(f33.type.value=="")
                                {
                                  alert("请选择类别");
                                  return false;
                                }
                                return true;
                             }
                             </script>
                        </form>
                         
                    </div>
                       
                       
                       
<%
String iorder = request.getParameter("iorder"); 
if(iorder==null&&session.getAttribute("iorder")==null)
{
iorder = "1";
session.setAttribute("iorder","1");
}else{
  iorder = iorder==null?session.getAttribute("iorder").toString():iorder;
  session.setAttribute("iorder",iorder);
}
 %>
                    <!-- Nav -->
                    <nav id="nav">
                        <ul class="sf-menu"> 
                            <li <%=Info.getClass("1",request)%>><a href="/wallpaper/index.jsp?iorder=1">&nbsp;&nbsp;首页. &nbsp;&nbsp;</a></li>
                            <li <%=Info.getClass("2",request)%>><a href="/wallpaper/siteinfo.jsp?id=4&iorder=2">&nbsp;网站简介.&nbsp;</a></li>
                            <li <%=Info.getClass("3",request)%>><a href="/wallpaper/resource.jsp?type=1&iorder=3">&nbsp;自然风光.&nbsp;</a></li>
                            <li <%=Info.getClass("4",request)%>><a href="/wallpaper/resource.jsp?type=2&iorder=4">&nbsp;社会人文.&nbsp;</a></li> 
                            <li <%=Info.getClass("5",request)%>><a href="/wallpaper/resource.jsp?type=3&iorder=5">&nbsp;艺术作品.&nbsp;</a></li>
                            <li <%=Info.getClass("6",request)%>><a href="/wallpaper/resource.jsp?type=4&iorder=6">&nbsp;科技科幻.&nbsp;</a></li> 
                            <li <%=Info.getClass("7",request)%>><a href="/wallpaper/siteinfo.jsp?id=6&iorder=7">&nbsp;联系我们.&nbsp;</a></li>
                            <li <%=Info.getClass("8",request)%>><a href="/wallpaper/guestbook.jsp?1=1&iorder=8">&nbsp;留言板.&nbsp;</a></li>
                        </ul> 
                    </nav>
                    <!-- /Nav -->
                     
                </div>
                  
            </div>
        </header>
        <!-- /Header -->
        
        
        <%
        String style = "";
        if(!request.getRequestURL().toString().contains("/admin/")){
         %>
        <!-- Slider -->
        <section id="slider">
            <div class="container">
                <div class="main-slider">
                	<div class="badg">
                    	<p><a href="#">Popular.</a></p>
                    </div>
                	<div class="flexslider">
                        <ul class="slides">
                            
                            
                            <%
                            for(HashMap m:new CommDAO().select("select * from mixinfo where infotype='滚动图片' order by id")){
                             %>
                            <li>
                                <img src="/wallpaper/upfile/<%=m.get("filename") %>" height="291" width="791" alt="MyPassion" />
                                <p class="flex-caption"><a href="<%=m.get("remo") %>"><%=m.get("mtitle") %></a> <%=m.get("cotitle") %> </p>
                            </li>
                             <%} %>
                            
                        </ul>
                    </div>
                </div>
                
                
                  <%
                   List<HashMap> pushlist = new CommDAO().select("select * from resources where ipush='是' order by id desc",1,4);
                  HashMap m1 = pushlist.get(0);
                  HashMap m2 = pushlist.get(1);
                  HashMap m3 = pushlist.get(2);
                  HashMap m4 = pushlist.get(3);
                  %>
                
                
                <div class="slider2" style="margin-right: 4px">
                	<div class="badg">
                    	<p><a href="#">Latest.</a></p>
                    </div>
                    <a href="#"><img src="/wallpaper/upfile/<%=m1.get("filename") %>" width="195" height="143" alt="MyPassion" /></a>
                    <p class="caption">
                     <%=m1.get("title") %>
                     </p>
                </div>
                
                <div class="slider3" >
                	<a href="#"><img src="/wallpaper/upfile/<%=m2.get("filename") %>" width="195" height="143" alt="MyPassion" /></a>
                    <p class="caption"><a href="#"><%=m2.get("title") %></a></p>
                </div>
                 
                
                <div class="slider3" style="margin-right: 4px">
                	<a href="#"><img src="/wallpaper/upfile/<%=m3.get("filename") %>" width="195" height="143" alt="MyPassion" /></a>
                    <p class="caption"><a href="#"><%=m3.get("title") %></a></p>
                </div>
                
                <div class="slider3">
                	<a href="#"><img src="/wallpaper/upfile/<%=m4.get("filename") %>" width="195" height="143" alt="MyPassion" /></a>
                    <p class="caption"><a href="#"><%=m4.get("title") %></a></p>
                </div>
                
            </div>    
        </section>
        <!-- / Slider -->
        <%}else{ %> 
        <%} %>
       
